<?php
session_start();
include ("src/jpgraph.php");
include ("src/jpgraph_bar.php");

$houqin_zongshu = $_SESSION[houqin_zongshu];
$gongcheng_zongshu = $_SESSION[gongcheng_zongshu];
$gongyi_zongshu = $_SESSION[gongyi_zongshu];
$anhuan_zongshu = $_SESSION[anhuan_zongshu];
$shengchan_zongshu = $_SESSION[shengchan_zongshu];
$zongshu = $_SESSION[zongshu];

$datay = array($gongyi_zongshu, $gongcheng_zongshu, $shengchan_zongshu, $houqin_zongshu, $anhuan_zongshu, $zongshu);

// Create the graph. These two calls are always required
$graph = new Graph(600,300,"auto");    
$graph->SetScale("textlin");

// Add a drop shadow
$graph->SetShadow();

// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,40,40,40);

// Create a bar pot
$bplot = new BarPlot($datay);

// Adjust fill color
$bplot->SetFillColor('orange');

// Setup values
$bplot->value->Show();
$bplot->value->SetFormat('%d');
$bplot->value->SetFont(FF_FONT1,FS_BOLD);

// Center the values in the bar
$bplot->SetValuePos('center');

// Make the bar a little bit wider
$bplot->SetWidth(0.7);

$graph->Add($bplot);

//x
$xdata=array('1','2','3','4','5','total');
$graph->xaxis->SetTickLabels($xdata);
//$graph->xaxis->SetTextLabelInterval(2);

// Setup the titles
$graph->title->Set("Statistic of Suggestions");
$graph->xaxis->title->Set("Type");
$graph->yaxis->title->Set("Number");

$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);

// Display the graph
$graph->Stroke();


?>


